home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 476-500 / disk_500 / swindows / swindows.doc < prev    next >
Text File  |  1992-05-06  |  7KB  |  159 lines

  1. OVERVIEW:
  2.  
  3. SWINDOWS is a program that allows you to use the title of a window to
  4. specify the screen on which the window will appear.  This provides a 
  5. method for opening CON: and RAW: windows on screens other than the 
  6. workbench, for example, but can also be used with any other type of window.
  7.  
  8.  
  9. HOW TO USE SWINDOWS:
  10.  
  11. You should place sWindows in your C: directory (or in your current path),
  12. and sWindows-Handler should be put in the L: directory (or in the current
  13. directory).  To start sWindows, simply type SWINDOWS at the CLI prompt:
  14.  
  15.     1> sWindows
  16.  
  17. You do not need to RUN sWindows, since sWindows loads the handler code
  18. separately, sets up the handler, and then exits.  To remove sWindows, 
  19. simply issue the sWindows command a second time.
  20.  
  21. Once sWindows is running, you can open a window on any screen simply by
  22. including the name of the screen in the title of the window.  Separate the
  23. screen name from the window title by two colons (::).  For example, if
  24. you want to open a CLI on a screen called "Test Screen", then you could
  25. do the following:
  26.  
  27.     1> NEWCLI "NEWCON:0/0/300/50/Test Screen::CLI Window"
  28.  
  29. sWindows will see the "Test Screen::" portion of the name, and will attempt
  30. to open a window with title "CLI Window" on the screen which is called
  31. "Test Screen".
  32.  
  33. You need not specify the complete screen name, just enough for sWindows to
  34. find it (e.g, you could have used "Test::CLI Window" in the previous example).
  35. Upper and lower case are not distinguished (so "test::CLI Window" and 
  36. "TEST:CLI Window" also would work).  Spacing and special characters within
  37. the name ARE important, and need to be included if they exist in the screen
  38. title.  You can use a utility like wList to view all the screen titles.
  39.  
  40. If a screen with the name you supplied does not exist, sWindows opens the
  41. window on the workbench screen (or whatever screen was specified in the 
  42. NewWindow strucutre used to open the window), and does not modify the 
  43. title (i.e., the screen name and "::" appear in the window title).
  44.  
  45. If you specify "::" without a screen name (e.g., "::MyWindow"), then
  46. sWindows will open the window on the active screen.  For example, if you are
  47. using a program that opens it's own screen, and you are asked to specify an
  48. input file name, you could supply "NEWCON:0/0/300/75/::Input Window" as the 
  49. file name, and sWindows would open an input window on the screen you are 
  50. working on.  You could type data directly into the program this way, rather 
  51. than having to create a file containing the data (press CTRL-\ when you are 
  52. done entering data).  This is useful for small amounts of data, when you want
  53. a quick result from a program that does not have an interactive input mode.
  54.  
  55. Another use would be to use the ^X! command of MEMACS to execute the
  56. following command:
  57.  
  58.     ^X! NEWSHELL NEWCON:0/0/640/100/::EmacsShell
  59.  
  60. This would cause a new Shell window to open on the EMACS screen.  That way
  61. you could give CLI commands on the same screen you are using for your
  62. editing, so that you don't have to keep changing screens.
  63.  
  64. The "::" syntax can be useful if you write programs as well.  For example,
  65. if you are writing a screen color-adjusting program, you could open a window
  66. titled "::Palette" and it would open on the active screen.  If you wanted
  67. the user to be able to supply a screen name, you could simply concatinate
  68. "::Palette" to the name the user supplied.  If the screen exists, sWindows
  69. will open the palette on that screen.  If the user did not supply a name, it
  70. would open on the active screen.  
  71.  
  72. Or, if you wanted a calculator program that could open on any screen, you 
  73. could simply call the calculator window "::Calculator".  (NB: you can not 
  74. get the calculator supplied on the Workbench disk to open in this way since 
  75. it opens a window with NULL title, and then uses SetWindowTitles() to modify
  76. it.  If you could find the NewWindow structure in the executable, you could 
  77. change the NULL title).
  78.  
  79.  
  80. USAGE NOTES:
  81.  
  82. Since windows use the same bitmaps as the screens on which they open, any
  83. window that you open using sWindows will have the same number of bit-planes
  84. and colors as the screen where it opens.
  85.  
  86. Applications that use their own screens may not be expecting other windows
  87. to open on their screens, and hence may not include code to update their
  88. windows on refresh events.  Thus opening windows on these screens may damage
  89. the information displayed on the screen.  Or the application my write
  90. directly to the screen memory, bypassing window structures completely.  In
  91. this case, the information in the windows that you open on that screen may
  92. be damaged by updates performed by the application.  Be aware that these
  93. situations can occur.
  94.  
  95. If you open a window on an application's screen, it may not be aware that
  96. your window exists, and may try to close the screen even while your window
  97. still is open.  If the screen were to be closed at this point, and its
  98. memory and bitplanes freed, the results would most certainly include a
  99. system crash.  For this reason, sWindows traps calls to the CloseScreen()
  100. function and does not allow it to complete until all the windows that
  101. sWindow opened on that screen are closed.  This saves you from having to
  102. remember to close all the windows first.  The screen will remain open until
  103. all the windows (opened by sWindows) are closed.  In this case, the
  104. CloseScreen() call will not return until the last window is removed, so the
  105. task that called CloseScreen will Wait(), and will not complete until its
  106. screen can be closed.
  107.  
  108. You can make it easy to open Shell windows on any screen by using a 
  109. command procedure like the following:  make a file called ScrShell that 
  110. contains the lines:
  111.  
  112.     .keyword ScrName
  113.     NewShell "NEWCON:0/0/320/100/<ScrName>::ScreenShell"
  114.  
  115. and place the file in your command path.  Use PROTECT SCRSHELL +S to set
  116. the Script bit in the protection field.  Now if you type:
  117.  
  118.     1> ScrShell "Test Screen"
  119.  
  120. you should get a new Shell with its window on the screen called "Test Screen".
  121. Or you could just type SCRSHELL TEST, since you only need to supply a prefix
  122. for the screen title.
  123.  
  124. To open a new shell on the active screen, just use the command SCRSHELL without
  125. supplying a screen name.  This will open a shell window called
  126. "NEWCON:0/0/320/100/::ScreenShell", which sWindows will open on the active 
  127. screen.  For example, you can get a Shell on the EMACS screen by typing ^X!
  128. and then issuing the SCRSHELL command.
  129.  
  130. To make sWindows a part of your regular Amiga environment, add the SWINDOWS
  131. command (or SWINDOWS >NIL:) to your startup-sequence in the S: directory
  132. on your boot disk).
  133.  
  134.  
  135. COMPILING SWINDOWS:
  136.  
  137. sWindows was developed using the Lattice C compiler v4.0 on a 512K Amiga 1000.
  138. It probably will need to be modified to work with the Manx Aztec C compiler.
  139. To compile and link sWindows, use the following commands (these appear in
  140. sWindows.com, distributed with the source code):
  141.  
  142.     1> lc -v -b0 swMain swHandler swMemory swSetup
  143.     1> asm swStubs
  144.     1> blink with sWindows.lnk
  145.     1> blink with swHandler.lnk
  146.  
  147. The -v -b0 options are required.  You can add -r if you like.
  148.  
  149.  
  150. AUTHOR:
  151.  
  152. sWindows and sWindow-Handler
  153. Copyright 1989 by Davide P. Cervone, all rights reserved.
  154.  
  155. Davide P. Cervone
  156. Department of Mathematics, Box 1917                 ST402523@BROWNVM.BITNET
  157. Brown University                                    st402523@brownvm.brown.edu
  158. Providence, Rhode Island  02912                     dpvc@fermat.math.brown.edu
  159.